package com.cskaoyan.servlet;


import com.cskaoyan.bean.MarketFeedback;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.service.AdminFeedbackService;
import com.cskaoyan.service.AdminFeedbackServiceImpl;
import com.cskaoyan.util.ResponseUtil;
import com.cskaoyan.util.StringUtil;
import lombok.SneakyThrows;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//小组接口意见反馈信息的功能实现

@WebServlet("/admin/feedback/*")
public class AdminFeedbackServlet extends WdBaseServlet {

    AdminFeedbackService adminFeedbackService= new AdminFeedbackServiceImpl();


    @SneakyThrows
    private void list(HttpServletRequest request, HttpServletResponse response){


        String username = request.getParameter("username");


        Integer id = StringUtil.isEmpty(request.getParameter("id")) ? null : Integer.parseInt(request.getParameter("id"));


        Integer page = Integer.parseInt(request.getParameter("page"));

        Integer limit = Integer.parseInt(request.getParameter("limit"));

        String sort = request.getParameter("sort");
        String order = request.getParameter("order");

        CommonData<MarketFeedback> commonData = adminFeedbackService.list(id, username,  page, limit, sort, order);

        ResponseUtil.responseJson(response, BaseRespVo.ok(commonData));





    }



}
